home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / jazlib.arc / MOVES.ASM < prev    next >
Assembly Source File  |  1988-12-18  |  2KB  |  89 lines

  1. Comment *
  2. ┌────────────────────────────────────────────────────────────────────────────┐
  3. │Title     : moves                                 │
  4. │purpose : moves a buffer to the screen                      │
  5. │                                         │
  6. │This routine does a block move  avoiding snow on the Ibm color card.         │
  7. │It does this by monitering the video status bit at port location 0x3da      │
  8. │by Jack A. Zucker (jaz) 75766,1336 on jan 25,1986                 │
  9. └────────────────────────────────────────────────────────────────────────────┘
  10.  *
  11.  
  12. title    buffer moves
  13. name    moves
  14.  
  15.     assume cs:_text
  16. _text    segment public byte 'code'
  17.     public _moves
  18.  
  19. _moves     proc near
  20.  
  21.     push bp
  22.     mov bp,sp
  23.     push si
  24.     push di
  25.     push es
  26.     push ds
  27.  
  28.     mov ax,[bp + 4]     ; get source segment
  29.     mov ds,ax        ; in ds
  30.     mov si,[bp + 6]     ; get source offset
  31.     mov ax,[bp + 8]     ; get destin segment
  32.     mov es,ax        ; in es
  33.     mov di,[bp + 0Ah]    ; get destin offset
  34.     mov bx,di        ; save destin offset in bx
  35.     mov ax,[bp + 0Ch]    ; get number of rows
  36.     mov cx,[bp + 0Eh]    ; get number of columns
  37.     cmp [bp+8],0B000h    ; Mono?
  38.     jz mono
  39. next:
  40.     mov dx,3dah        ; address of 6845 Status register
  41.     push ax
  42. status_low:
  43.     in al,dx        ; get vertical retrace status
  44.     ror al,1        ; faster than test
  45.     jc status_low        ; wait for partially done retrace
  46.     cli            ; don't allow any more interrupts
  47. status_high:
  48.     in al,dx        ; wait for beginning of new retrace
  49.     ror al,1
  50.     jnc status_high     ; retrace not started
  51.  
  52.     movsw
  53.     sti            ; interrupts allowed now
  54.     pop ax
  55.     dec cx
  56.     or cx,cx
  57.     jnz next
  58.     add bx,160
  59.     mov di,bx
  60.     mov cx,[bp + 0Eh]
  61.     dec ax
  62.     or ax,ax
  63.     jnz next
  64.     jmp exit
  65.  
  66. mono:
  67.     movsw
  68.     dec cx
  69.     or cx,cx
  70.     jnz mono
  71.     add bx,160
  72.     mov di,bx
  73.     mov cx,[bp + 0Eh]
  74.     dec ax
  75.     or ax,ax
  76.     jnz mono
  77.  
  78. exit:
  79.     pop ds
  80.     pop es
  81.     pop di
  82.     pop si
  83.     mov sp,bp
  84.     pop  bp
  85.     ret
  86. _moves    endp
  87. _text    ends
  88.     end
  89.